function Person(name, age, friend) {
  // this = stu;
  this.name = name;
  this.age = age;
  this.friends = friend;
}

Person.prototype.eating = function () {
  console.log(this.name + "在吃饭");
};

function Student(name, age, friend, sno) {
  Person.call(this, name, age, friend);
  this.sno = sno;
}

// 直接将父类的原型赋值给子类，作为子类的原型
Student.prototype = Person.prototype;
// 但之后为子类添加的方法会被添加到父类的原型上面
Student.prototype.studying = function () {
  console.log(this.name + "在学习");
};

var stu = new Student("frank", 18, ["kobe"], 120);

console.log(stu);
stu.eating();
stu.studying();
